{*******************************************************************************
* The contents of this file are used with permission, subject to the Mozilla   *
* Public License Version 1.1 (the "License"); you may not use this file except *
* in compliance with the License. You may obtain a copy of the License at      *
* http://www.mozilla.org/MPL/                                                  *
*                                                                              *
* Software distributed under the License is distributed on an "AS IS" basis,   *
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for *
* the specific language governing rights and limitations under the License.    *
*                                                                              *
* The Original Code is distributed as part of the "mediate" product and is     *
* Copyright (C) @home media limited. All Rights Reserved.                      *
*                                                                              *
* Email: support@athomemedia.co.uk                                             *
* Web:   http://www.athomemedia.co.uk                                          *
*******************************************************************************}

unit AHMTypes;

interface

uses Types, Windows, SysUtils;

type
  // Custom exception types
  EXMLException = class(Exception);
  EDirectXException = class(Exception);
  EDirectShowException = class(Exception);
  EThemeException = class(Exception);
  EParsingException = class(Exception);
  EPluginException = class(Exception);
  EFunctionException = class(Exception);
  EConfigurationException = class(Exception);

  // These definitions correspond to GDI+ TGPRect and TGPRectF
  PAHMRect = ^TAHMRect;
  TAHMRect = packed record
    X     : Integer;
    Y     : Integer;
    Width : Integer;
    Height: Integer;
  end;
  PAHMRectF = ^TAHMRectF;
  TAHMRectF = packed record
    X     : Single;
    Y     : Single;
    Width : Single;
    Height: Single;
  end;

  // Common simple types used throughout mediate
  TAHMFunctionResult = (frSuccess, frFailed, frPartial);

  // OS specific equivalents for simple types
  TAHMTimestamp = Cardinal;
  TAHMMemoString = type String;
  TAHMTextString = type String;
  TAHMMetaString = type String;
  TAHMFunctionString = type String;
  TAHMFilename = type String;
  TAHMTypeface = type String;

  // Animation types
  TAHMAnimationType = (atUnknown, atFadeIn, atFadeOut, atSlide, atPause,
                       atMacro, atFunction, atRotate, atScale, atSize);

  // Media types
  TAHMMediaType = (mtParent, mtFolder, mtPlaylist, mtTheme, mtImage,
                   mtAudio, mtVideo, mtInfo, mtDVD, mtRadio, mtUnknown, mtAll);
  TAHMMediaTypes = set of TAHMMediaType;

  // Media stream types
  TAHMStreamType = (stPrimary, stSecondary, stPriThenSec, stSecThenPri);

  // Enumerated type to expose susbet of supported media types in theme designer
  TAHMMediaGridType = (mgAudio, mgVideo, mgPictures, mgRadio, mgAll);

  // Plugin types
  TAHMPluginType = (ptNative, ptExternal);

  // Theme resource types
  TAHMResourceType = (rtImage, rtSound);

  // Directions for cursor movement
  TAHMDirection = (diUp, diDown, diLeft, diRight, diNone);

  // Orientations for various things
  TAHMOrientation = (orVertical, orHorizontal);

  // Control states
  TAHMControlState = (csIdle, csFocused, csPressed, csDisabled, csHidden);

  // Control types
  TAHMControlType = (ctBar, ctButton, ctCaption, ctCheckButton, ctComboButton,
                     ctImage, ctGrid, ctMediaWindow, ctPlugin, ctRadioButton,
                     ctShape, ctTextEdit, ctClone, ctGauge, ctDial);

  // Depth types
  TAHMDepthType = (dtBackground, dtMidground, dtForeground);
                       
  // Do not change the order of these UIObject types - they correspond to Tag
  // properties used in each TAction defined in main Designer form. New types
  // should be appended to the existing list. Plugins are a special case as
  // they are constructed separately in the designer form so must appear last.
  TAHMUIObjectType = (otNone, otColours, otFills, otPlasma, otFonts, otBitmaps,
                      otBackgrounds, otForegrounds, otShapes, otCaptions,
                      otMediaWindows, otBars, otButtons, otMediaGrids,
                      otFunctions, otExpressions, otMacros, otActions, otMetaInfo,
                      otPlaces, otAnimators, otLayouts, otControls, otContainers,
                      otScreens, otSounds, otLanguages, otGrids, otTextEdits,
                      otTimers, otEffects, otPluginWindows, otGauges, otDials,
                      otGridItems, otPlugins); // Tags 0..35

  TAHMUIObjectTypes = set of TAHMUIObjectType;

  // Check states
  TAHMCheckState = (csChecked, csUnchecked, csToggle);

  // Mouse cursor display states
  TAHMMouseCursor = (mcShow, mcHide, mcAuto);

  // Mouse right button actions
  TAHMMouseRightAction = (mrMenu, mrDrag, mrDisable);

  // Video renderer types
  TAHMVideoRenderer = (vrVMR9, vrMVR);

  // Windows shutdown actions
  TAHMWindowsShutdown = (wsNone, wsSleep, wsPowerOff, wsReboot, wsHibernate);

  // Texture formats
  TAHMTextureFormat = (tf32Bit, tf16Bit);

  // Font quality
  TAHMFontQuality = (fqLow, fqStandard, fqHigh, fqUltra);
  
  // Audio mixing techniques
  TAHMAudioMixing = (amPause, amMute);

  // Bitmap processing operations
  TAHMBitmapProcess = (bpGlow);

const
  // Empty rectangle constants
  EmptyRect: TAHMRect = (X: 0; Y: 0; Width: 0; Height: 0);
  EmptyRectF: TAHMRectF = (X: 0.0; Y: 0.0; Width: 0.0; Height: 0.0);

implementation

end.
